<template>
  <div class="track_the_playback">
    <div class="around">
      <!-- 设置时间 -->
      <i class="el-icon-speed">{{ setTime.startTime }}</i>
      <i class="el-icon-speed">至</i>
      <i class="el-icon-speed">{{ setTime.endTime }}</i>
      <span class="buttonI" title="设置时间段" @click="setTime.show = true"
        >设置时间段</span
      >

      <span class="buttonI" title="展示轨迹" @click="getDataListM"
        >展示轨迹</span
      >
      <span class="buttonI" title="测距" @click="setDistance">测距</span>
      <!-- 选择车辆类型 -->

      <el-tooltip
        class="item"
        effect="dark"
        content="与车辆列表无关"
        placement="top-start"
      >
        <i class="el-icon-speed" title="区域">显示道路区域</i>
        <!-- <el-button type="danger" icon="el-icon-delete" circle  size="mini"></el-button> -->
      </el-tooltip>

      <el-select
        v-model="areaValue"
        placeholder="请选择区域"
        @change="getRoudAllGPS"
      >
        <el-option
          v-for="(item, index) in selectArea"
          :value="item.CLIENT_GROUP_NO"
          :label="item.CLIENT_GROUP_NAME"
          :key="index"
        ></el-option>
      </el-select>
      <!-- 数据列表 -->
      <!-- <span class="buttonI" title="打开数据列表" @click="openDataList"
        >打开数据列表</span
      > -->
      <!-- 开始播放 -->
      <!-- <span class="buttonI" title="开始播放" @click="start">播放轨迹</span> -->
      <!-- 停止播放 -->
      <!-- <span class="buttonI" title="停止播放" @click="stop">暂停播放</span> -->
      <div style="padding-top: 10px">
        <!-- 选择车辆类型 -->
        <i class="el-icon-speed" title="车辆类型">车辆类型</i>
        <el-select
          v-model="carTypeValue"
          placeholder="请选择车辆类型"
          @change="screenCarList"
        >
          <el-option
            v-for="(item, index) in selectCarType"
            :value="item.label"
            :label="item.value"
            :key="index"
          ></el-option>
        </el-select>
        <!-- 选择车辆 -->
        <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isHHCar"
            @change="getCarList"
          ></el-switch>
          <i class="el-icon-speed" style="margin-left: 10px"
            >只显示有轨迹车辆</i
          ></span
        >
        <i class="el-icon-speed" title="车辆名称">车辆名称</i>
        <el-select
          v-model="VID"
          placeholder="请选择车辆"
          ref="workcarname"
          filterable
          clearable
        >
          <el-option
            v-for="(item, index) in workCarSelectTypeList"
            :label="item.LICENSE_PLATE"
            :value="item.VID"
            :key="index"
          ></el-option>
        </el-select>
      </div>
      <div style="padding-top: 10px">
        <!-- 设置速度 -->
        <!-- <span class="buttonI" title="设置播放速度" @click="speed.show = true"
          >设置播放速度</span
        > -->
        <!-- 设置播放间隔步数 -->
        <!-- <span class="buttonI" title="设置播放间隔" @click="step.show = true"
          >设置播放间隔</span
        > -->
        <!-- 清除轨迹 -->
        <!-- <span class="buttonI" title="清除轨迹" @click="clear">清除轨迹</span> -->
        <!-- 设置时间标签显示 -->
        <!-- <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShowDateTimeTap"
            active-color="#13ce66"
          ></el-switch>
          <i
            class="el-icon-speed"
            title="显示日期时间标签"
            style="margin-left: 10px"
            >显示日期时间标签</i
          ></span
        > -->
        <!-- 设置时间标签显示 -->
        <!-- <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShowTimeTap"
            active-color="#13ce66"
          ></el-switch>
          <i
            class="el-icon-speed"
            title="显示时间标签"
            style="margin-left: 10px"
            >显示时间标签</i
          ></span
        > -->
        <!-- 图片导出 -->
        <!-- <span class="buttonI" title="图片导出" @click="savepic">图片导出</span> -->
        <!-- 图片导出 -->

        <!-- <span class="buttonI" title="设置时间标签显示">设置时间标签显示</span>
      <el-switch
        v-model="isShowTimeTap"
        active-color="#007ACC"
        style="border: 2px solid #fff; border-radius: 12px"
      ></el-switch> -->
        <!-- <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShow.switchFinal"
            active-color="#DC143C"
            @change="showFinal"
          ></el-switch>
          <i
            class="el-icon-speed"
            title="显示原始+新算法投影后的轨迹"
            style="margin-left: 10px"
            >显示原始+新算法投影后的轨迹</i
          ></span
        > -->
        <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShow.switchLastTime"
            active-color="#4444FF"
            @change="showLastTime"
          ></el-switch>
          <i
            class="el-icon-speed"
            title="显示旧算法轨迹"
            style="margin-left: 10px"
            >显示旧算法轨迹</i
          ></span
        >
        <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShow.switchNew"
            active-color="#006400"
            @change="showNew"
          ></el-switch>
          <i
            class="el-icon-speed"
            title="显示新算法轨迹"
            style="margin-left: 10px"
            >显示新算法轨迹</i
          ></span
        >
        <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShow.switch0624"
            active-color="#FF1493"
            @change="show0624"
          ></el-switch>
          <i
            class="el-icon-speed"
            title="显示6月24临时算法轨迹"
            style="margin-left: 10px"
            >显示6月24临时算法轨迹</i
          ></span
        >
        <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShow.switchOriginal"
            active-color="#FFA500"
            @change="showOriginal"
          ></el-switch>
          <i
            class="el-icon-speed"
            title="显示原始轨迹"
            style="margin-left: 10px"
            >显示原始轨迹</i
          ></span
        >
        <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShow.switchRoad"
            active-color="#696969"
            @change="showRoad"
          ></el-switch>
          <i class="el-icon-speed" title="显示道路" style="margin-left: 10px"
            >显示道路</i
          ></span
        >
        <!-- <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShowDateTimeTap"
            active-color="#13ce66"
          ></el-switch>
          <i class="el-icon-speed" title="显示新点" style="margin-left: 10px"
            >显示新点</i
          ></span
        > -->
        <!-- <span style="margin-left: 5px">
          <el-switch
            class="el-checkbox-show"
            v-model="isShowDateTimeTap"
            active-color="#13ce66"
          ></el-switch>
          <i class="el-icon-speed" title="显示旧点" style="margin-left: 10px"
            >显示旧点</i
          ></span
        > -->
      </div>
    </div>
    <!-- 地图 -->
    <div class="container" style="padding: 0px">
      <div id="mapPlayback"></div>
    </div>
    <!-- 上方显示隐藏图标操作栏,多选 -->
    <!-- <div class="map-operation">
      <ul>
        <li
          v-for="(item,index) in mapOperationsList"
          :class="{'active': item.active}"
          :key="index"
          @click="changeOperationValue(item, index)"
        >
          <i :class="item.icon"></i>
          {{ item.name }}
        </li>
      </ul>
    </div> -->
    <!-- 播放拖动条 -->
    <div class="arounds">
      <el-slider
        v-model="setSlider.value"
        :step="setSlider.step"
        :max="setSlider.max"
        :format-tooltip="formatTooltipSlider"
        @input="inputSlider"
      ></el-slider>
    </div>
    <!-- 数据列表 -->
    <el-dialog
      title="点位数据列表"
      :visible.sync="dataListDialog"
      width="49%"
      class="dialogchild"
    >
      <el-form class="dialogform">
        <el-table
          :data="array.pointFinal"
          style="width: 100%"
          fit
          max-height="450"
          highlight-current-row
        >
          <!-- {"Lng":"117.449241907762","Lat":"38.8629691205361","Speed":"50","Direction":"西","GpsTime":"2020/12/21 9:16:47"}, -->
          <el-table-column
            prop="GPSTIME"
            label="定位时间"
            width="180"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="SPEED"
            label="速度"
            width="180"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="DIRECTION"
            label="方向"
            width="180"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="LNG"
            label="经度"
            width="180"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="LAT"
            label="纬度"
            width="180"
            align="center"
          ></el-table-column>
        </el-table>
      </el-form>
    </el-dialog>
    <!-- 设置轨迹开始时间、结束时间 -->
    <div class="set_time_box" v-if="setTime.show">
      <h2>
        <span>设置时间段</span>
        <i class="iconfont icon-guanbi" @click="setTime.show = false"></i>
      </h2>
      <div class="block"></div>
      <div class="settingWindow">
        <div>
          <span>开始日期：</span>
          <!-- <el-date-picker
            v-model="setTime.startTime"
            placeholder="选择开始日期"
            value-format="yyyy-MM-dd"
          ></el-date-picker> -->
          <el-date-picker
            v-model="setTime.startTime"
            type="datetime"
            placeholder="选择开始日期"
            value-format="yyyy-MM-dd HH:mm:ss"
          ></el-date-picker>
        </div>
        <div>
          <span>结束日期：</span>
          <!-- <el-date-picker
            v-model="setTime.endTime"
            placeholder="选择结束日期"
            value-format="yyyy-MM-dd"
          ></el-date-picker> -->
          <el-date-picker
            v-model="setTime.endTime"
            type="datetime"
            placeholder="选择结束日期"
            value-format="yyyy-MM-dd HH:mm:ss"
          ></el-date-picker>
        </div>
        <div>
          <el-button
            type="text"
            @click="changeTimeQ"
            style="left: 0.9vw; width: 2.6vw"
            >全天查看</el-button
          >
          <el-button
            type="text"
            @click="changeTimeZ"
            style="left: 4vw; width: 2.6vw"
            >作业查看</el-button
          >
          <el-button type="primary" @click="setTime.show = false"
            >确 定</el-button
          >
        </div>
      </div>
    </div>
    <!-- <el-dialog title="选择时间" :visible.sync="dialogFormVisible">
            <el-form :model="form">
              <el-form-item label="开始时间：">
                <el-date-picker
                  v-model="setTime.startTime"
                  type="datetime"
                  placeholder="选择开始时间"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  default-time="00:00:00"
                ></el-date-picker>
              </el-form-item>
              <el-form-item label="结束时间：">
                <el-date-picker
                  v-model="setTime.endTime"
                  type="datetime"
                  placeholder="选择结束时间"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  default-time="23:59:59"
                ></el-date-picker>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="dialogFormVisible = false">取 消</el-button>
              <el-button type="primary" @click="dialogFormVisible = false"
                >确 定</el-button
              >
            </div>
          </el-dialog> -->
    <!-- 设置播放速度 -->
    <div class="speed" v-if="speed.show">
      <h2>
        <span>设置播放速度</span>
        <i class="iconfont icon-guanbi" @click="speed.show = false"></i>
      </h2>
      <el-slider
        v-model="speed.value"
        :step="0.1"
        :max="2"
        :min="0.1"
        :format-tooltip="formatSpeed"
      ></el-slider>
      <el-button type="primary" @click="speed.show = false">确 定</el-button>
    </div>
    <!-- 设置播放间隔 -->
    <div class="speed" v-if="step.show">
      <h2>
        <span>设置播放间隔</span>
        <i class="iconfont icon-guanbi" @click="step.show = false"></i>
      </h2>
      <el-slider v-model="step.value" :step="1" :max="20" :min="1"></el-slider>
      <el-button type="primary" @click="step.show = false">确 定</el-button>
    </div>
  </div>
</template>

<script>
import { formatDate } from '@/common/js/date.js'

import DirectionImg from '@/assets/img/playback/direction.png'
import DirectionImg1 from '@/assets/img/playback/direction1.png'
import ImageStart from '@/assets/img/playback/begin3.png'
import ImageEnd from '@/assets/img/playback/end3.png'

import imgMarkerCLC from '@/assets/img/marker/markerImageCLC.png'
import imgMarkerZZZ from '@/assets/img/marker/markerImageZZZ.png'
import imgMarkerNCD from '@/assets/img/marker/markerImageLarge.png'
import imgMarkerCY from '@/assets/img/marker/markerImageSmall.png'
import imgMarkerXQCY from '@/assets/img/marker/markerImageVillage.png'
import html2canvas from "html2canvas";
export default {
  data () {
    return {
      isHHCar: false,
      isShow: {
        switch0624: true,
        switchOriginal: true,
        switchNew: true,
        switchFinal: true,
        switchLastTime: true,
        switchRoad: true,
      },
      fgw: {
        lineOriginal: null,
        lineNew: null,
        lineFinal: null,
        lineLastTime: null,
        line0624: null,
        pointCollectionOriginal: null,
        pointCollectionOriginalSuper: null,
        pointCollectionNew: null,
        pointCollectionFinal: null,
        pointCollectionLastTime: null,
        pointCollection0624: null,
      },
      array: {
        pointOriginal: [],
        pointNew: [],
        pointFinal: [],
        pointLastTime: [],
        point0624: [],
        roadPolyline: [],
      },
      setSlider: {
        max: 100,
        value: 0,
        step: 1
      },
      mapCursor: null,
      map: null,
      mapZoom: 20,
      markerWithSlider: null,
      dataListDialog: false,
      dataCurrentIndex: 0,
      isShowTimeTap: true,
      isShowDateTimeTap: false,
      dialogFormVisible: false,
      ary: [],
      VID: 0,
      setTime: {
        show: false,
        // startTime: new Date(new Date() - 3600 * 1000 * 24),
        // endTime: new Date()
        startTime: formatDate(new Date(new Date() - 3600 * 1000 * 24), 'yyyy-MM-dd hh:mm:ss'),
        endTime: formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
      },
      timeId: null,
      // 速度
      speed: {
        show: false,
        value: 0.2
      },
      // 步数
      step: {
        show: false,
        value: 1
      },
      mapOperationsList: [{
        name: '转运站',
        icon: 'el-icon-knife-fork',
        active: false
      }, {
        name: '处理厂',
        icon: 'el-icon-tableware',
        active: false
      }, {
        name: '农村垃圾点',
        icon: 'el-icon-refrigerator',
        active: false
      }, {
        name: '小区垃圾点',
        icon: 'el-icon-refrigerator',
        active: false
      }, {
        name: '餐饮单位',
        icon: 'el-icon-refrigerator',
        active: false
      }],
      workCarList: [],
      workCarSelectTypeList: [],
      carTypeValue: '全部',
      areaValue: '',
      selectArea: [],
      selectCarType: [{
        value: '全部',
        label: '全部'
      }, {
        value: '机扫车',
        label: '机扫车'
      }, {
        value: '小型机扫车',
        label: '小型机扫车'
      }, {
        value: '吸尘车',
        label: '吸尘车'
      }, {
        value: '洒水车',
        label: '洒水车'
      }, {
        value: '高压清洗车',
        label: '高压清洗车'
      }, {
        value: '洗路车',
        label: '洗路车'
      }, {
        value: '多功能洗扫车',
        label: '多功能洗扫车'
      }, {
        value: '除雪车',
        label: '除雪车'
      }],
      isshow: {

      },
      MapOverlay: {
        arrayCLCMapOverlay: [],
        arrayZZZMapOverlay: [],
        arrayNCDMapOverlay: [],
        arrayCYMapOverlay: [],
        arrayXQCYMapOverlay: []
      },
      Data: {
        arrayCLCPolygonData: [],
        arrayCLCMarkerData: [],
        arrayZZZMarkerData: [],
        arrayNCDMarkerData: [],
        arrayXQCYMarkerData: [],
        arrayCYMarkerData: []
      }
    }
  },
  created () {
    // var intVID = this.$route.query.VID
    // this.VID = intVID.toString()
    // this.carTypeValue = this.$route.query.CARTYPE
    // if (this.$route.query.TIME) {
    //   var dateString = this.$route.query.TIME;
    //   this.setTime.startTime = formatDate(new Date(new Date(dateString) - 3600 * 1000), 'yyyy-MM-dd hh:mm:ss')
    //   this.setTime.endTime = formatDate(new Date(dateString), 'yyyy-MM-dd hh:mm:ss')
    //   console.log(this.setTime)
    // }
  },
  methods: {
    // 测距
    setDistance () {
      if (!this.mapCursor) {
        this.mapCursor = new BMapLib.DistanceTool(this.map);
      }
      if (this.mapCursor.isOpen) {
        // 结束测量
        this.mapCursor.close();
      } else {
        // 开始测量
        this.mapCursor.open();
      }
    },
    // 显示地图
    mapShow () {
      // 百度地图API功能
      this.map = new BMap.Map('mapPlayback');
      this.map.enableScrollWheelZoom(true)
      this.map.centerAndZoom(new BMap.Point(localStorage.getItem('LNG'), localStorage.getItem('LAT')), this.mapZoom)// 初始化地图,设置中心点坐标和地图级别

      var myIcon = new BMap.Icon(DirectionImg, new BMap.Size(32, 32), { anchor: new BMap.Size(20, 20) })
      this.markerWithSlider = new BMap.Marker(new BMap.Point(0, 0), { icon: myIcon })
      this.markerWithSlider.disableMassClear()
      this.map.addOverlay(this.markerWithSlider)
    },
    async getClientInfo () {
      const loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)'
      })
      var url = 'Vehicle/GetClientInfo?client_no=' + localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      this.selectArea = data;
      if (data.length > 0) {
        this.areaValue = data[0].CLIENT_GROUP_NO
      }
      loading.close()
      this.getRoudAllGPS()
    },
    getCarList () { // 16232
      if (this.isHHCar) {
        this.getHaveHistoryCarList()
      } else {
        this.getAllCarList()
      }
    },
    async getHaveHistoryCarList () {
      this.clear()
      if (this.setTime.startTime === '' || this.setTime.endTime === '') {
        this.$message({
          message: '请选择日期',
          type: 'warning'
        })
        return false
      }
      const params = {
        CLIENTNO: localStorage.getItem('CLIENT_NO'),
        BEGINDATE: this.setTime.startTime,
        ENDDATE: this.setTime.endTime,
        CARTYPE: '机扫'
      }
      const loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)'
      })
      await this.$Http.get('Vehicle/GetVehicleCarListSelectHaveHistoryInfo', { params })
        .then((result) => {
          this.workCarList = result.data
          this.screenCarList()
          loading.close()
        })

    },
    async getAllCarList () {
      // let date = new Date(this.$refs.historytime.value);
      // let str=formatDate(date,'yyyy-MM-dd');
      // var url = 'Vehicle/GetCarInfo?workdate=' + this.setTime.startTime + '&client_no=' + localStorage.getItem('CLIENT_NO') // zxdata
      const loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)'
      })
      var url = 'Vehicle/GetVehicleCarListSelect?ClientNo=' + localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      this.workCarList = data;
      this.screenCarList()
      loading.close()
    },
    screenCarList () {
      console.log(this.carTypeValue)
      if (this.carTypeValue !== '全部') {
        this.workCarSelectTypeList = this.workCarList.filter(item => item.CAR_TYPE === this.carTypeValue)
      } else {
        this.workCarSelectTypeList = this.workCarList
      }
      if (this.VID == 0 && this.workCarSelectTypeList.length > 0) {
        this.VID = this.workCarSelectTypeList[0].VID
      }
    },
    // 全天查看
    changeTimeQ () {
      this.setTime.startTime = this.setTime.startTime.slice(0, 10) + ' 00:00:00'
      this.setTime.endTime = this.setTime.startTime.slice(0, 10) + ' 23:59:59'
    },

    // 作业查看
    changeTimeZ () {
      let sdate = new Date(this.setTime.startTime);
      let edate = new Date(this.setTime.startTime);

      sdate.setDate(sdate.getDate() - 1);
      edate.setDate(edate.getDate());

      this.setTime.startTime = sdate.toISOString().split('T')[0].slice(0, 10) + ' 18:00:00'
      this.setTime.endTime = edate.toISOString().split('T')[0].slice(0, 10) + ' 18:00:00'
    },
    // 选定时间段,获取数据列表
    async getDataList (params) { // 16232
      // 设置加载效果
      const loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)'
      })
      await this.$Http.get('Vehicle/GetVehicleHistoryInfo', { params })
        .then((result) => {
          //下面是如果对返回结果再进行处理，根据项目需要
          // console.log(result)
          loading.close()
          this.array.pointOriginal = result.data;
          this.array.pointFinal = []
          if (result.data.length != 0 && this.array.pointNew.length != 0) {
            var indexR = 0
            var indexM = 0
            // for (let indexM = 0; indexM < this.array.pointNew.length; indexM++) {
            //     const elementM = this.array.pointNew[indexM];
            for (let index = indexR; index < this.array.pointOriginal.length; index++) {
              const element = this.array.pointOriginal[index];
              const elementM = this.array.pointNew[indexM];
              if (elementM.GPSTIME === element.GPSTIME) {
                this.array.pointFinal.push(elementM)
                for (let i = indexM; i < (this.array.pointNew.length - 1); i++) {
                  const element0 = this.array.pointNew[i];
                  const element1 = this.array.pointNew[i + 1];
                  var date0 = new Date(element0.GPSTIME);
                  var date1 = new Date(element1.GPSTIME);

                  var diffInMilliseconds = Math.abs(date1 - date0);
                  var diffInSeconds = diffInMilliseconds / 1000;
                  // console.log('M差-' + diffInSeconds)
                  if (diffInSeconds < 15) {
                    this.array.pointFinal.push(element1)
                  } else {
                    indexM = (i + 1);
                    break;
                  }
                }
              } else {
                if (indexM > 0) {
                  const element1 = this.array.pointNew[indexM - 1];
                  var date0 = new Date(element.GPSTIME);
                  var date1 = new Date(element1.GPSTIME);
                  if (date1 < date0) {
                    this.array.pointFinal.push(element)
                  }
                } else {
                  this.array.pointFinal.push(element)
                }
              }
            }
            console.log('this.array.pointFinal')
            console.log(this.array.pointFinal)

            this.setSlider.max = this.array.pointFinal.length

          }
          this.setTime.show = false
          this.drawPictureOriginal()
          this.drawPictureLastTime()
          this.drawPicture0624()
          this.drawPictureNew()
          // this.drawPictureFinal()
        })
      // .catch((err) => {
      //   loading.close()
      //   console.log('err:', err)
      //   // this.$message.error('当前网络状态不稳定，请稍后重试');
      //   this.$alert('当前网络状态不稳定，请稍后重试', {
      //     confirmButtonText: '确定',
      //     // callback: action => {
      //     // }
      //   });
      //   reject()
      // })
      // const { data } = await this.$Http.get('Vehicle/GetVehicleHistoryInfo', { params })

    },

    async getDataListM () { // 16232
      this.clear()
      if (this.setTime.startTime === '' || this.setTime.endTime === '') {
        this.$message({
          message: '请选择日期',
          type: 'warning'
        })
        return false
      }

      const params = {
        VID: this.VID,
        StartDate: this.setTime.startTime,
        EndDate: this.setTime.endTime
      }
      // const params = {
      //   // VID: this.VID,
      //   VID: '18711',
      //   StartDate: '2025-03-29 22:13:00',
      //   EndDate: '2025-03-29 23:15:00',
      //   // StartDate: this.setTime.startTime,
      //   // EndDate: this.setTime.endTime
      // }
      // const params = {
      //   VID: '4599',
      //   StartDate: '2025-03-28 18:00:00',
      //   EndDate: '2025-03-29 18:00:00'
      // }
      // const params = {
      //   VID: '18711',
      //   StartDate: '2025-03-09 00:00:00',
      //   EndDate: '2025-03-29 23:59:59'
      // }
      // 设置加载效果
      const loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)'
      })
      await this.$Http.get('Vehicle/GetVehicleHistoryInfoLH0613', { params })
        .then((result) => {
          this.array.pointNew = result.data
          loading.close()
          this.getDataListLastTime(params)
        })
    },
    async getDataListLastTime (params) { // 16232
      // 设置加载效果
      const loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)'
      })
      await this.$Http.get('Vehicle/GetVehicleHistoryInfoModifyOld', { params })
        .then((result) => {
          this.array.pointLastTime = result.data
          loading.close()
          this.getDataList0624(params)
        })
    },
    async getDataList0624 (params) { // 16232
      // 设置加载效果
      const loading = this.$loading({
        lock: true,
        text: '数据加载中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)'
      })
      await this.$Http.get('Vehicle/GetVehicleHistoryInfoModify', { params })
        .then((result) => {
          this.array.point0624 = result.data
          loading.close()
          this.getDataList(params)
        })
    },
    // 轨迹回放逐步播放点
    async playTrack () {
      const data = this.array.pointFinal
      // 以第一个坐标点为地图中心点
      // this.map.centerAndZoom(new BMap.Point(data[0].LNG, data[0].LAT), 20)
      const _this = this

      // 定时画线
      this.timeId = setInterval(() => {
        // 清除定时器，停止画线
        if (this.dataCurrentIndex === data.length - 1) {
          this.stop()
          this.dataCurrentIndex = 0
          return true
        }
        // 上一个点
        this.dataCurrentIndex = this.dataCurrentIndex + this.step.value
        const prevPoint = this.dataCurrentIndex - this.step.value
        // if (data[this.dataCurrentIndex].LOCK == 1 && data[prevPoint].LOCK == 1) {
        //   add(data[prevPoint].LNG, data[prevPoint].LAT, data[this.dataCurrentIndex].LNG, data[this.dataCurrentIndex].LAT, '#FF00FF')
        // } else {
        //   add(data[prevPoint].LNG, data[prevPoint].LAT, data[this.dataCurrentIndex].LNG, data[this.dataCurrentIndex].LAT, 'black')
        // }
        // 下一个点
        this.createPoint(data[prevPoint].LNG, data[prevPoint].LAT, data[this.dataCurrentIndex].LNG, data[this.dataCurrentIndex].LAT, data[prevPoint].GPSTIME, data[prevPoint].OUTSPEED)
      }, 1000 * this.speed.value)
      // })
      // 画线
      // function add (lng1, lat1, lng2, lat2, color) {
      //   const pt1 = new BMap.Point(lng1, lat1)
      //   const pt2 = new BMap.Point(lng2, lat2)
      //   // _this.ary.push(new BMap.Point(point.LNG, point.LAT))
      //   const polyline = new BMap.Polyline([pt1, pt2], { strokeColor: color, strokeWeight: 3, strokeOpacity: 1 })
      //   _this.map.addOverlay(polyline)
      // }
    },
    // 创建标记点
    createPoint (lng1, lat1, lng2, lat2, datePoint, isOUTSPEED) {
      // 获取两个标记点的角度
      const k = this.getAngle(lng1, lat1, lng2, lat2)
      // 创建标记点
      const pt = new BMap.Point(lng1, lat1)
      // 标记点图片
      var myIcon = new BMap.Icon(DirectionImg, new BMap.Size(20, 26))
      if (isOUTSPEED === '1') {
        myIcon = new BMap.Icon(DirectionImg1, new BMap.Size(20, 26))
      }
      // 添加图片
      const marker = new BMap.Marker(pt, { icon: myIcon })
      // 设置标记点方向
      marker.setRotation(k)
      // 将标注添加到地图中
      this.map.addOverlay(marker)
      if (this.isShowTimeTap) {
        console.log(datePoint);
        var label = new BMap.Label(datePoint.split(" ")[1], { offset: new BMap.Size(-10, 50) })
        marker.setLabel(label)
      } else if (this.isShowDateTimeTap) {
        var label = new BMap.Label(datePoint, { offset: new BMap.Size(-10, 50) })
        marker.setLabel(label)
      }
      // 如果点位在当前地图显示范围外，则将该点设置为地图中心
      if (!this.map.getBounds().containsPoint(pt)) {
        this.map.centerAndZoom(pt, this.mapZoom)
      }
    },
    // 获取两个点的角度
    getAngle (lng1, lat1, lng2, lat2) {
      const a = (90 - lat2) * Math.PI / 180
      const b = (90 - lat1) * Math.PI / 180
      const AOC_BOC = (lng2 - lng1) * Math.PI / 180
      const cosc = Math.cos(a) * Math.cos(b) + Math.sin(a) * Math.sin(b) * Math.cos(AOC_BOC)
      const sinc = Math.sqrt(1 - cosc * cosc)
      const sinA = Math.sin(a) * Math.sin(AOC_BOC) / sinc
      const A = Math.asin(sinA) * 180 / Math.PI
      let res = 0
      if (lng2 > lng1 && lat2 > lat1) res = A
      else if (lng2 > lng1 && lat2 < lat1) res = 180 - A
      else if (lng2 < lng1 && lat2 < lat1) res = 180 - A
      else if (lng2 < lng1 && lat2 > lat1) res = 360 + A
      else if (lng2 > lng1 && lat2 === lat1) res = 90
      else if (lng2 < lng1 && lat2 === lat1) res = 270
      else if (lng2 === lng1 && lat2 > lat1) res = 0
      else if (lng2 === lng1 && lat2 < lat1) res = 180
      return res
    },
    // 打开数据列表
    openDataList () {
      this.dataListDialog = true
    },
    //画出整个轨迹

    drawPictureOriginal () {
      if (this.array.pointOriginal.length < 1) {
        return;
      }
      const _this = this
      var pointArr = [];
      var boundPoints = [];
      for (var i = 0; i < this.array.pointOriginal.length; i++) {
        var item = this.array.pointOriginal[i]
        pointArr.push(new BMap.Point(item.LNG, item.LAT))
        boundPoints.push(new BMap.Point(item.LNG, item.LAT))
      }
      this.fgw.lineOriginal = new BMap.Polyline(pointArr, {
        strokeColor: '#FFA500',
        strokeWeight: 13,
        strokeOpacity: 0.8,
      });
      this.map.addOverlay(this.fgw.lineOriginal);
      this.map.setViewport(boundPoints);

      var points = []
      var pointsSuper = []
      this.array.pointOriginal.forEach(element => {
        if (element.OUTSPEED === '1') {
          pointsSuper.push(new BMap.Point(element.LNG, element.LAT));
        } else {
          points.push(new BMap.Point(element.LNG, element.LAT));
        }
      });
      var options = {
        size: BMAP_POINT_SIZE_SMALL,
        // shape: BMAP_POINT_SHAPE_STAR,
        color: '#FFFF00'
      }
      this.fgw.pointCollectionOriginal = new BMap.PointCollection(points, options);  // 初始化PointCollection
      this.map.addOverlay(this.fgw.pointCollectionOriginal);

      var optionsS = {
        size: BMAP_POINT_SIZE_BIG,
        shape: BMAP_POINT_SHAPE_STAR,
        color: '#FFFF00'
      }
      this.fgw.pointCollectionOriginalSuper = new BMap.PointCollection(pointsSuper, optionsS);  // 初始化PointCollection
      this.map.addOverlay(this.fgw.pointCollectionOriginalSuper);


      this.fgw.pointCollectionOriginal.addEventListener("click", function (e) {
        if (!_this.isShow.switchOriginal) {
          return
        }
        _this.array.pointOriginal.forEach(element => {
          if (element.LNG === e.point.lng && element.LAT === e.point.lat) {
            // 信息窗体
            const opts = {
              width: 180,     // 信息窗口宽度
              height: 50,     // 信息窗口高度
              title: '原始轨迹信息', // 信息窗口标题
            }
            let str = `<p style="margin-top: 15px;">${element.GPSTIME.replace('T', ' ')}</p>`
            const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
            _this.map.openInfoWindow(infoWindow, e.point) //开启信息窗口
          }
        });
      });
      this.fgw.pointCollectionOriginalSuper.addEventListener("click", function (e) {
        if (!_this.isShow.switchOriginal) {
          return
        }
        _this.array.pointOriginal.forEach(element => {
          if (element.LNG === e.point.lng && element.LAT === e.point.lat) {
            // 信息窗体
            const opts = {
              width: 180,     // 信息窗口宽度
              height: 100,     // 信息窗口高度
              title: '原始轨迹信息', // 信息窗口标题
            }
            const str = `<p style="margin-top: 15px;">${element.GPSTIME.replace('T', ' ')}</p>
            <p style="margin-top: 15px;">当前超速: ${element.SPEED} 迈</p>
            `
            const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
            _this.map.openInfoWindow(infoWindow, e.point) //开启信息窗口
          }
        });
      });
      if (!this.isShow.switchOriginal) {
        this.showOriginal(false)
      }
    },
    drawPicture0624 () {
      if (this.array.point0624.length < 1) {
        return;
      }

      this.fgw.line0624 = []
      var pointArr = [new BMap.Point(this.array.point0624[0].LNG, this.array.point0624[0].LAT)];
      for (let i = 0; i < (this.array.point0624.length - 1); i++) {
        const element0 = this.array.point0624[i];
        const element1 = this.array.point0624[i + 1];

        if (element0.Mask === 0 || element1.Mask === 0) {
          var date0 = new Date(element0.GPSTIME);
          var date1 = new Date(element1.GPSTIME);

          var diffInMilliseconds = Math.abs(date1 - date0);
          var diffInSeconds = diffInMilliseconds / 1000;
          // console.log('M差-' + diffInSeconds)
          if (diffInSeconds < 16) {
            pointArr.push(new BMap.Point(element1.LNG, element1.LAT))
          } else {
            if (pointArr.length > 1) {
              var line = new BMap.Polyline(pointArr, {
                strokeColor: '#FF1493',
                strokeWeight: 8,
                strokeOpacity: 0.8,
              });
              this.map.addOverlay(line);
              this.fgw.line0624.push(line)
            }
            pointArr = [new BMap.Point(element1.LNG, element1.LAT)]
          }
        } else {
          pointArr.push(new BMap.Point(element1.LNG, element1.LAT))
        }
      }
      if (pointArr.length > 1) {
        var line = new BMap.Polyline(pointArr, {
          strokeColor: '#FF1493',
          strokeWeight: 8,
          strokeOpacity: 0.8,
        });
        this.map.addOverlay(line);
        this.fgw.line0624.push(line)
      }

      var points0 = []
      var points1 = []
      var points2 = []
      var points3 = []
      // var points4 = []
      var pointsOther = []
      this.array.point0624.forEach(element => {
        switch (element.Mask) {
          case 0:
            points0.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case 1:
            points1.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case 2:
            points2.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case 3:
            points3.push(new BMap.Point(element.LNG, element.LAT));
            break;
          // case '4':
          //   points4.push(new BMap.Point(element.LNG, element.LAT));
          //   break;
          default:
            pointsOther.push(new BMap.Point(element.LNG, element.LAT));
            break;
        }
      });

      this.fgw.pointCollection0624 = []
      this.fgw.pointCollection0624.push(this.drawPCM0624(points0, 0))
      this.fgw.pointCollection0624.push(this.drawPCM0624(points1, 1))
      this.fgw.pointCollection0624.push(this.drawPCM0624(points2, 2))
      this.fgw.pointCollection0624.push(this.drawPCM0624(points3, 3))
      // this.fgw.pointCollection0624.push(this.drawPCM0624(points4, 4))
      this.fgw.pointCollection0624.push(this.drawPCM0624(pointsOther, 4))

      if (!this.isShow.switch0624) {
        this.show0624(false)
      }
    },
    drawPCM0624 (points, mask) {

      var options = {
        size: BMAP_POINT_SIZE_SMALL,
        // shape: BMAP_POINT_SHAPE_STAR,
        color: '#DB7093'
      }
      switch (mask) {
        case 0:
          options.shape = BMAP_POINT_SHAPE_CIRCLE
          break;
        case 1: {
          options.shape = BMAP_POINT_SHAPE_STAR
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#FFC0CB'
        }
          break;
        case 2: {
          options.shape = BMAP_POINT_SHAPE_SQUARE
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#FFC0CB'
        }
          break;
        case 3: {
          options.shape = BMAP_POINT_SHAPE_RHOMBUS
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#FFC0CB'
        }
          break;
        case 4: {
          options.shape = BMAP_POINT_SHAPE_WATERDROP
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#FFC0CB'
        }
          break;
        default: {
          options.shape = BMAP_POINT_SHAPE_WATERDROP
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#FFC0CB'
        }
          break;
      }
      var pointCollection = new BMap.PointCollection(points, options);  // 初始化PointCollection
      this.map.addOverlay(pointCollection);

      const _this = this
      pointCollection.addEventListener("click", function (e) {
        if (!_this.isShow.switch0624) {
          return
        }
        _this.array.point0624.forEach(element => {
          if (element.LNG === e.point.lng && element.LAT === e.point.lat) {
            let infoMask = element.Mask;
            switch (element.Mask) {
              case 0:
                infoMask += '，原始轨迹点'
                break;
              case 1:
                infoMask += '，道路两端补点'
                break;
              case 2:
                infoMask += '，掉头补点'
                break;
              case 3:
                infoMask += '，小斜线补点'
                break;
                case 4:
                infoMask += '，过路口修正点'
                break;
                case 5:
                infoMask += '，同路段补点'
                break;
                case 6:
                infoMask += '，同路补点'
                break;
                case 7:
                infoMask += '，跨一条道路补点'
                break;
              default:
                break;
            }
            // 信息窗体
            const opts = {
              width: 180,     // 信息窗口宽度
              height: 100,     // 信息窗口高度
              title: '投影轨迹信息', // 信息窗口标题
            }
            const str = `<p style="margin-top: 15px;">${element.GPSTIME.replace('T', ' ')}</p>
            <p style="margin-top: 15px;">Mask: ${infoMask}</p>
            `
            const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
            _this.map.openInfoWindow(infoWindow, e.point) //开启信息窗口
          }
        });
      });
      return pointCollection;
    },
    drawPictureLastTime () {
      if (this.array.pointLastTime.length < 1) {
        return;
      }

      this.fgw.lineLastTime = []
      var pointArr = [new BMap.Point(this.array.pointLastTime[0].LNG, this.array.pointLastTime[0].LAT)];
      for (let i = 0; i < (this.array.pointLastTime.length - 1); i++) {
        const element0 = this.array.pointLastTime[i];
        const element1 = this.array.pointLastTime[i + 1];

        if (element0.Mask === 0 || element1.Mask === 0) {
          var date0 = new Date(element0.GPSTIME);
          var date1 = new Date(element1.GPSTIME);

          var diffInMilliseconds = Math.abs(date1 - date0);
          var diffInSeconds = diffInMilliseconds / 1000;
          // console.log('M差-' + diffInSeconds)
          if (diffInSeconds < 16) {
            pointArr.push(new BMap.Point(element1.LNG, element1.LAT))
          } else {
            if (pointArr.length > 1) {
              var line = new BMap.Polyline(pointArr, {
                strokeColor: '#4444FF',
                strokeWeight: 12,
                strokeOpacity: 0.8,
              });
              this.map.addOverlay(line);
              this.fgw.lineLastTime.push(line)
            }
            pointArr = [new BMap.Point(element1.LNG, element1.LAT)]
          }
        } else {
          pointArr.push(new BMap.Point(element1.LNG, element1.LAT))
        }
      }
      if (pointArr.length > 1) {
        var line = new BMap.Polyline(pointArr, {
          strokeColor: '#4444FF',
          strokeWeight: 12,
          strokeOpacity: 0.8,
        });
        this.map.addOverlay(line);
        this.fgw.lineLastTime.push(line)
      }

      var points0 = []
      var points1 = []
      var points2 = []
      var points3 = []
      // var points4 = []
      var pointsOther = []
      this.array.pointLastTime.forEach(element => {
        switch (element.Mask) {
          case 0:
            points0.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case 1:
            points1.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case 2:
            points2.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case 3:
            points3.push(new BMap.Point(element.LNG, element.LAT));
            break;
          // case '4':
          //   points4.push(new BMap.Point(element.LNG, element.LAT));
          //   break;
          default:
            pointsOther.push(new BMap.Point(element.LNG, element.LAT));
            break;
        }
      });

      this.fgw.pointCollectionLastTime = []
      this.fgw.pointCollectionLastTime.push(this.drawPCMLastTime(points0, 0))
      this.fgw.pointCollectionLastTime.push(this.drawPCMLastTime(points1, 1))
      this.fgw.pointCollectionLastTime.push(this.drawPCMLastTime(points2, 2))
      this.fgw.pointCollectionLastTime.push(this.drawPCMLastTime(points3, 3))
      // this.fgw.pointCollectionLastTime.push(this.drawPCMLastTime(points4, 4))
      this.fgw.pointCollectionLastTime.push(this.drawPCMLastTime(pointsOther, 4))

      if (!this.isShow.switchLastTime) {
        this.showLastTime(false)
      }
    },
    drawPCMLastTime (points, mask) {

      var options = {
        size: BMAP_POINT_SIZE_SMALL,
        // shape: BMAP_POINT_SHAPE_STAR,
        color: '#1E90FF'
      }
      switch (mask) {
        case 0:
          options.shape = BMAP_POINT_SHAPE_CIRCLE
          break;
        case 1: {
          options.shape = BMAP_POINT_SHAPE_STAR
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#00FFFF'
        }
          break;
        case 2: {
          options.shape = BMAP_POINT_SHAPE_SQUARE
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#00FFFF'
        }
          break;
        case 3: {
          options.shape = BMAP_POINT_SHAPE_RHOMBUS
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#00FFFF'
        }
          break;
        case 4: {
          options.shape = BMAP_POINT_SHAPE_WATERDROP
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#00FFFF'
        }
          break;
        default: {
          options.shape = BMAP_POINT_SHAPE_WATERDROP
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#00FFFF'
        }
          break;
      }
      var pointCollection = new BMap.PointCollection(points, options);  // 初始化PointCollection
      this.map.addOverlay(pointCollection);

      const _this = this
      pointCollection.addEventListener("click", function (e) {
        if (!_this.isShow.switchLastTime) {
          return
        }
        _this.array.pointLastTime.forEach(element => {
          if (element.LNG === e.point.lng && element.LAT === e.point.lat) {
            let infoMask = element.Mask;
            switch (element.Mask) {
              case 0:
                infoMask += '，原始轨迹点'
                break;
              case 1:
                infoMask += '，道路两端补点'
                break;
              case 2:
                infoMask += '，掉头补点'
                break;
              case 3:
                infoMask += '，小斜线补点'
                break;
                case 4:
                infoMask += '，过路口修正点'
                break;
                case 5:
                infoMask += '，同路段补点'
                break;
                case 6:
                infoMask += '，同路补点'
                break;
                case 7:
                infoMask += '，跨一条道路补点'
                break;
              default:
                break;
            }
            // 信息窗体
            const opts = {
              width: 180,     // 信息窗口宽度
              height: 100,     // 信息窗口高度
              title: '投影轨迹信息', // 信息窗口标题
            }
            const str = `<p style="margin-top: 15px;">${element.GPSTIME.replace('T', ' ')}</p>
            <p style="margin-top: 15px;">Mask: ${infoMask}</p>
            `
            const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
            _this.map.openInfoWindow(infoWindow, e.point) //开启信息窗口
          }
        });
      });
      return pointCollection;
    },
    drawPictureNew () {
      if (this.array.pointNew.length < 1) {
        return;
      }

      this.fgw.lineNew = []
      var pointArr = [new BMap.Point(this.array.pointNew[0].LNG, this.array.pointNew[0].LAT)];
      // for (var i = 0; i < this.array.pointNew.length; i++) {
      //   var item = this.array.pointNew[i]
      //   pointArr.push(new BMap.Point(item.LNG, item.LAT))
      // }
      // var maskLine = this.array.pointNew[0].Mask
      for (let i = 0; i < (this.array.pointNew.length - 1); i++) {
        const element0 = this.array.pointNew[i];
        const element1 = this.array.pointNew[i + 1];

        if (element0.Mask === 0 || element1.Mask === 0) {
          var date0 = new Date(element0.GPSTIME);
          var date1 = new Date(element1.GPSTIME);

          var diffInMilliseconds = Math.abs(date1 - date0);
          var diffInSeconds = diffInMilliseconds / 1000;
          // console.log('M差-' + diffInSeconds)
          if (diffInSeconds < 16) {
            pointArr.push(new BMap.Point(element1.LNG, element1.LAT))
          } else {
            if (pointArr.length > 1) {
              var line = new BMap.Polyline(pointArr, {
                strokeColor: '#32CD32',
                strokeWeight: 6,
                strokeOpacity: 0.8,
              });
              this.map.addOverlay(line);
              this.fgw.lineNew.push(line)
            }
            pointArr = [new BMap.Point(element1.LNG, element1.LAT)]
          }
        } else {
          pointArr.push(new BMap.Point(element1.LNG, element1.LAT))
        }
      }
      if (pointArr.length > 1) {
        var line = new BMap.Polyline(pointArr, {
          strokeColor: '#32CD32',
          strokeWeight: 6,
          strokeOpacity: 0.8,
        });
        this.map.addOverlay(line);
        this.fgw.lineNew.push(line)
      }

      var points0 = []
      var points1 = []
      var points2 = []
      var points3 = []
      // var points4 = []

      var pointsOther = []
      this.array.pointNew.forEach(element => {
        switch (element.Mask) {
          case '0':
            points0.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case '1':
            points1.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case '2':
            points2.push(new BMap.Point(element.LNG, element.LAT));
            break;
          case '3':
            points3.push(new BMap.Point(element.LNG, element.LAT));
            break;
          // case '4':
          //   points4.push(new BMap.Point(element.LNG, element.LAT));
          //   break;
          default:
            pointsOther.push(new BMap.Point(element.LNG, element.LAT));
            break;
        }
      });
      this.fgw.pointCollectionNew = []
      this.fgw.pointCollectionNew.push(this.drawPCM(points0, 0))
      this.fgw.pointCollectionNew.push(this.drawPCM(points1, 1))
      this.fgw.pointCollectionNew.push(this.drawPCM(points2, 2))
      this.fgw.pointCollectionNew.push(this.drawPCM(points3, 3))
      // this.fgw.pointCollectionNew.push(this.drawPCM(points4, 4))
      this.fgw.pointCollectionNew.push(this.drawPCM(pointsOther, 4))
      if (!this.isShow.switchNew) {
        this.showNew(false)
      }
    },
    drawPCM (points, mask) {

      var options = {
        size: BMAP_POINT_SIZE_SMALL,
        // shape: BMAP_POINT_SHAPE_STAR,
        color: '#00FF00'
      }
      switch (mask) {
        case 0:
          options.shape = BMAP_POINT_SHAPE_CIRCLE
          break;
        case 1: {
          options.shape = BMAP_POINT_SHAPE_STAR
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#006400'
        }
          break;
        case 2: {
          options.shape = BMAP_POINT_SHAPE_SQUARE
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#006400'
        }
          break;
        case 3: {
          options.shape = BMAP_POINT_SHAPE_RHOMBUS
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#006400'
        }
          break;
        case 4: {
          options.shape = BMAP_POINT_SHAPE_RHOMBUS
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#006400'
        }
          break;
        default: {
          options.shape = BMAP_POINT_SHAPE_WATERDROP
          options.size = BMAP_POINT_SIZE_BIG
          options.color = '#006400'
        }
          break;
      }
      var pointCollection = new BMap.PointCollection(points, options);  // 初始化PointCollection
      this.map.addOverlay(pointCollection);

      const _this = this
      pointCollection.addEventListener("click", function (e) {
        if (!_this.isShow.switchNew) {
          return
        }
        _this.array.pointNew.forEach(element => {
          if (element.LNG === e.point.lng && element.LAT === e.point.lat) {
            let infoMask = element.Mask;
            switch (element.Mask) {
              case '0':
                infoMask += '，原始轨迹点'
                break;
              case '1':
                infoMask += '，道路两端补点'
                break;
              case '2':
                infoMask += '，掉头补点'
                break;
              case '3':
                infoMask += '，小斜线补点'
                break;
                case '4':
                infoMask += '，过路口修正点'
                break;
                case '5':
                infoMask += '，同路段补点'
                break;
                case '6':
                infoMask += '，同路补点'
                break;
                case '7':
                infoMask += '，跨一条道路补点'
                break;
              default:
                break;
            }
            // 信息窗体
            const opts = {
              width: 180,     // 信息窗口宽度
              height: 100,     // 信息窗口高度
              title: '新轨迹信息', // 信息窗口标题
            }
            const str = `<p style="margin-top: 15px;">${element.GPSTIME.replace('T', ' ')}</p>
            <p style="margin-top: 15px;">Mask: ${infoMask}</p>
            `
            const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
            _this.map.openInfoWindow(infoWindow, e.point) //开启信息窗口
          }
        });
      });
      return pointCollection;
    },
    showOriginal (val) {
      if (this.array.pointOriginal.length < 1) {
        this.$message.warning('未获取到原始轨迹');
      } else if (val) {
        // 当开关打开时的逻辑
        this.fgw.lineOriginal.show()
        this.fgw.pointCollectionOriginal.show()
        this.fgw.pointCollectionOriginalSuper.show()
      } else {
        // 当开关关闭时的逻辑
        this.fgw.lineOriginal.hide()
        this.fgw.pointCollectionOriginal.hide()
        this.fgw.pointCollectionOriginalSuper.hide()
      }
    },
    showLastTime (val) {
      if (this.array.pointLastTime.length < 1) {
        this.$message.warning('未获取到旧算法轨迹');
      } else if (val) {
        // 当开关打开时的逻辑
        this.fgw.lineLastTime.forEach(element => {
          element.show();
        });
        // this.fgw.lineLastTime.show()
        // this.fgw.pointCollectionLastTime.show()
        this.fgw.pointCollectionLastTime.forEach(element => {
          element.show();
        });
      } else {
        // 当开关关闭时的逻辑
        this.fgw.lineLastTime.forEach(element => {
          element.hide();
        });
        // this.fgw.lineLastTime.hide()
        // this.fgw.pointCollectionLastTime.hide()
        this.fgw.pointCollectionLastTime.forEach(element => {
          element.hide();
        });
      }
    },
    show0624 (val) {
      if (this.array.point0624.length < 1) {
        this.$message.warning('未获取到0624临时算法轨迹');
      } else if (val) {
        // 当开关打开时的逻辑
        this.fgw.line0624.forEach(element => {
          element.show();
        });
        // this.fgw.line0624.show()
        // this.fgw.pointCollection0624.show()
        this.fgw.pointCollection0624.forEach(element => {
          element.show();
        });
      } else {
        // 当开关关闭时的逻辑
        this.fgw.line0624.forEach(element => {
          element.hide();
        });
        // this.fgw.line0624.hide()
        // this.fgw.pointCollection0624.hide()
        this.fgw.pointCollection0624.forEach(element => {
          element.hide();
        });
      }
    },
    showNew (val) {
      if (this.array.pointNew.length < 1) {
        this.$message.warning('未获取到新算法轨迹');
      } else if (val) {
        // 当开关打开时的逻辑
        this.fgw.lineNew.forEach(element => {
          element.show();
        });
        // this.fgw.lineNew.show()
        // this.fgw.pointCollectionNew.show()
        this.fgw.pointCollectionNew.forEach(element => {
          element.show();
        });
      } else {
        // 当开关关闭时的逻辑
        this.fgw.lineNew.forEach(element => {
          element.hide();
        });
        // this.fgw.lineNew.hide()
        // this.fgw.pointCollectionNew.hide()
        this.fgw.pointCollectionNew.forEach(element => {
          element.hide();
        });
      }
    },
    showFinal (val) {
      if (this.array.pointFinal.length < 1) {
        this.$message.warning('未获取到原始+新算法轨迹');
      } else if (val) {
        // 当开关打开时的逻辑
        this.fgw.lineFinal.show()
      } else {
        // 当开关关闭时的逻辑
        this.fgw.lineFinal.hide()
      }
    },
    showRoad (val) {
      if (this.array.roadPolyline.length < 1) {
        this.$message.warning('当前区域未获取到道路');
      } else if (val) {
        // 当开关打开时的逻辑
        this.array.roadPolyline.forEach(element => {
          element.show()
        });
      } else {
        // 当开关关闭时的逻辑
        this.array.roadPolyline.forEach(element => {
          element.hide()
        });
      }
    },
    drawPictureFinal () {
      if (this.array.pointFinal.length < 1) {
        return;
      }
      const _this = this
      var pointArr = [];

      var lastLock = 0
      for (var i = 0; i < this.array.pointFinal.length; i++) {
        var item = this.array.pointFinal[i]
        item.GPSTIME = item.GPSTIME.replace('T', ' ')
        pointArr.push(new BMap.Point(item.LNG, item.LAT))

      }
      this.fgw.lineFinal = new BMap.Polyline(pointArr, {
        strokeColor: '#DC143C',
        strokeWeight: 2,
        strokeOpacity: 0.8,
      });
      this.map.addOverlay(this.fgw.lineFinal);

      var markerStart = new BMap.Marker(new BMap.Point(this.array.pointFinal[0].LNG, this.array.pointFinal[0].LAT), { icon: new BMap.Icon(ImageStart, new BMap.Size(40, 34), { anchor: new BMap.Size(20, 34) }) })
      this.map.addOverlay(markerStart)
      var markerEnd = new BMap.Marker(new BMap.Point(this.array.pointFinal[(this.array.pointFinal.length - 1)].LNG, this.array.pointFinal[(this.array.pointFinal.length - 1)].LAT), { icon: new BMap.Icon(ImageEnd, new BMap.Size(40, 34), { anchor: new BMap.Size(20, 34) }) })
      this.map.addOverlay(markerEnd)

      if (!this.isShow.switchFinal) {
        this.showFinal(false)
      }

    },
    // 编辑经纬度信息
    async getRoudAllGPS () {
      this.array.roadPolyline.forEach(element => {
        element.enableMassClear()
        this.map.removeOverlay(element)
      });
      this.array.roadPolyline = []
      // this.arrayRoadName = []
      // this.map.clearOverlays()
      var url = "Vehicle/GetClientRoadGPSInfoModify?ClientNO=" + this.areaValue
      const { data } = await this.$Http.get(url)
      var rid = data[0].ROUDID
      var rname = data[0].NAME
      var rGrade = data[0].RGrade
      var points = []
      // var pointAll = []

      for (let index = 0; index < data.length; index++) {
        const element = data[index];
        if (element.ROUDID === rid && element.NAME === rname) {
          points.push(new BMap.Point(element.LNG, element.LAT))
          // pointAll.push(new BMap.Point(element.LNG, element.LAT))
        } else {
          this.drawRoad(rid, rname, rGrade, points)

          rid = element.ROUDID
          rname = element.NAME
          rGrade = element.RGrade
          points = []
          points.push(new BMap.Point(element.LNG, element.LAT))
          // districtName = element.行政区划
        }
        element.numS = points.length
      }
      this.drawRoad(rid, rname, rGrade, points)
      // this.map.setViewport(pointAll);

      // this.getRoadUnSettingInitial()
    },
    drawRoad (rid, rname, rGrade, points) {
      // 道路画线
      var polyline = new BMap.Polyline(points, { strokeColor: "#696969", strokeWeight: 20, strokeOpacity: 0.5 });   //创建折线
      this.map.addOverlay(polyline);
      polyline.disableMassClear()

      polyline.rid = rid
      polyline.rname = rname
      polyline.rGrade = rGrade

      this.array.roadPolyline.push(polyline)

      // var lineCenter = polyline.getBounds().getCenter()

      // this.arrayRoadName.push({
      //   geometry: {
      //     type: 'Point',
      //     coordinates: [lineCenter.lng, lineCenter.lat]
      //   },
      //   text: rname,
      //   roadID: rid
      // })

      // var label = new BMap.Label(rname, { position: lineCenter, offset: new BMap.Size(-20, -10) })
      // polyline.LabelP = label
      // label.rGrade = rGrade

      // label.setStyle({
      //   borderColor: '#fff',
      //   padding: '2px',
      //   borderRadius: '5px', // 可能内存成本很高
      // })
      // this.map.addOverlay(label);
      // this.arrayRoadNameLabel.push(label)
      // if (!this.checkedRoadName) {
      //   label.hide()
      // }

      const _this = this
      polyline.addEventListener('click', function (e) {
        // 信息窗体
        const opts = {
          width: 180,     // 信息窗口宽度
          height: 50,     // 信息窗口高度
          title: '道路名称', // 信息窗口标题
        }
        const str = `<p style="margin-top: 15px;">${this.rname}</p>`
        const infoWindow = new BMap.InfoWindow(str, opts)  // 创建信息窗口对象 
        _this.map.openInfoWindow(infoWindow, e.point) //开启信息窗口

        // console.log(this.rname)
        // console.log(e)
        // _this.addRoudInfo(this.rname, 1)
      })
    },
    inputSlider (val) {
      // console.log(this.setSlider.value)
      // 设置标记点坐标位置
      var pointChangeSlider = new BMap.Point(this.array.pointFinal[val].LNG, this.array.pointFinal[val].LAT)
      this.markerWithSlider.setPosition(pointChangeSlider)
      // 获取两个标记点的角度
      var k = 0
      if (val > 0) {
        k = this.getAngle(this.array.pointFinal[(val - 1)].LNG, this.array.pointFinal[(val - 1)].LAT, this.array.pointFinal[val].LNG, this.array.pointFinal[val].LAT)
      }
      // 设置标记点方向
      this.markerWithSlider.setRotation(k)
      // 如果点位在当前地图显示范围外，则将该点设置为地图中心
      if (!this.map.getBounds().containsPoint(pointChangeSlider)) {
        this.map.centerAndZoom(pointChangeSlider, this.mapZoom)
      }
    },
    // 开始播放
    start () {
      this.dataListDialog = false
      // if (this.dataCurrentIndex === 0) {
      //   this.clear()
      // }
      if (this.timeId == null) {
        this.playTrack()
      }

    },
    // 停止播放
    stop () {
      clearTimeout(this.timeId)
      this.timeId = null
    },
    // 清除轨迹
    clear () {
      this.stop()
      this.ary = []
      this.dataCurrentIndex = 0
      this.markerWithSlider.setPosition(new BMap.Point(0, 0))
      this.map.clearOverlays()
    },
    // 格式化播放间隔
    formatSpeed (val) {
      return val + ' 秒播放一步'
    },
    formatTooltipSlider (val) {
      if (val > 0) {
        return this.array.pointFinal[val - 1].GPSTIME
      }
    },
    // 获取处理厂
    async getPlacePointCLCApi () {
      var url = 'Vehicle/getPlaceCLC?CLIENTNO=' + localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      this.Data.arrayCLCMarkerData = data
    },
    // 获取转运站
    async getPlacePointZZZApi () {
      var url = 'Vehicle/getPlaceZZZ?CLIENTNO=' + localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      this.Data.arrayZZZMarkerData = data
    },
    // 获取农村点
    async getPlacePointNCDApi () {
      var url = 'Vehicle/getPlaceNCD?CLIENTNO=' + localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      this.Data.arrayNCDMarkerData = data
    },
    // 获取餐饮单位
    async getPlacePointCYApi () {
      var url = 'Vehicle/getPlaceNCD?CLIENTNO=' + localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      this.Data.arrayCYMarkerData = data
    },
    // 获取小区垃圾点
    async getPlacePointXQCYApi () {
      var url = 'Vehicle/getPlaceNCD?CLIENTNO=' + localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      this.Data.arrayXQCYMarkerData = data
    },
    async handleCheckZZZ () {
      console.log(this.Data.arrayZZZMarkerData)
      if (this.mapOperationsList[0].active) {
        this.Data.arrayZZZMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerZZZ, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.NAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayZZZMapOverlay.push(marker)
        })
      } else {
        for (var i = 0; i < this.MapOverlay.arrayZZZMapOverlay.length; i++) {
          this.MapOverlay.arrayZZZMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayZZZMapOverlay[i])
        }
        this.MapOverlay.arrayZZZMapOverlay = []
      }
    },
    async handleCheckCLC () {
      if (this.mapOperationsList[1].active) {
        this.Data.arrayCLCMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerCLC, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.NAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayCLCMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayCLCMapOverlay.length; i++) {
          this.MapOverlay.arrayCLCMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayCLCMapOverlay[i])
        }
        this.MapOverlay.arrayCLCMapOverlay = []
      }
    },
    async handleCheckNCD () {
      if (this.mapOperationsList[2].active) {
        this.Data.arrayNCDMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerNCD, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.POINTNAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayNCDMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayNCDMapOverlay.length; i++) {
          this.MapOverlay.arrayNCDMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayNCDMapOverlay[i])
        }
        this.MapOverlay.arrayNCDMapOverlay = []
      }
    },
    async handleCheckCY () {
      if (this.mapOperationsList[4].active) {
        this.Data.arrayCYMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerCY, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.POINTNAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayCYMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayCYMapOverlay.length; i++) {
          this.MapOverlay.arrayCYMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayCYMapOverlay[i])
        }
        this.MapOverlay.arrayCYMapOverlay = []
      }
    },
    //小区
    async handleCheckXQCY () {
      if (this.mapOperationsList[3].active) {
        this.Data.arrayXQCYMarkerData.forEach(element => {
          // {"ID":1,"NAME":"1984生活广场","PARENT_NO":"0000019","PARENT_NAME":null,"CLIENT_NO":"000001900","CLIENT_NAME":"塘沽","TYPE":3,"LONGITUDE":117.706085,"LATITUDE":39.02312,"UPDATE_TIME":"2020-12-23T17:14:21.78"}
          var point = new BMap.Point(element.LONGITUDE, element.LATITUDE)
          var markerImage = new BMap.Icon(imgMarkerXQCY, new BMap.Size(50, 50))
          var marker = new BMap.Marker(point, { icon: markerImage })
          var label = new BMap.Label(element.POINTNAME, { offset: new BMap.Size(-10, 50) })
          marker.setLabel(label)
          marker.disableMassClear()
          this.map.addOverlay(marker)
          this.MapOverlay.arrayXQCYMapOverlay.push(marker)
        });
      } else {
        for (var i = 0; i < this.MapOverlay.arrayXQCYMapOverlay.length; i++) {
          this.MapOverlay.arrayXQCYMapOverlay[i].enableMassClear()
          this.map.removeOverlay(this.MapOverlay.arrayXQCYMapOverlay[i])
        }
        this.MapOverlay.arrayXQCYMapOverlay = []
      }
    },
    async handleCheckCLCPolygon () {
      // if (document.getElementById('checkbox_clc').checked) {
      var pointPolygon = []
      this.Data.arrayCLCPolygonData.forEach(item => {
        var point = new BMap.Point(item.经度, item.纬度)
        pointPolygon.push(point)
      })
      var polygon = new BMap.Polygon(pointPolygon)
      polygon.disableMassClear()
      this.map.addOverlay(polygon)
      this.MapOverlay.arrayCLCMapOverlay.push(polygon)
    },
    // 改变右上方显示隐藏图标
    changeOperationValue (item, index) {

      item.active = !item.active

      switch (index) {
        case 0:
          this.handleCheckZZZ()
          break;
        case 1:
          this.handleCheckCLC()
          break;
        case 2:
          this.handleCheckNCD()
          break;
        case 3:
          this.handleCheckXQCY()
          break;
        case 4:
          this.handleCheckCY()
          break;
        default:
          break;
      }
    },
    //截屏保存成图片
    async savepic () {
      let canvas = document.querySelector(".track_the_playback");
      let that = this;
      html2canvas(canvas, {
        useCORS: true,
        tainttest: true,
        allowTaint: true,
        width: canvas.getBoundingClientRect().width,
        height: canvas.getBoundingClientRect().height,
      }).then(function (canvas) {
        let type = "png";
        let imgData = canvas.toDataURL(type);
        // 照片格式处理
        let _fixType = function (type) {
          type = type.toLowerCase().replace(/jpg/i, "jpeg");
          let r = type.match(/png|jpeg|bmp|gif/)[0];
          return "image/" + r;
        };
        imgData = imgData.replace(_fixType(type), "image/octet-stream");
        let filename = "轨迹回放图片" + "." + type;
        that.saveFile(imgData, filename);
      });
    },
    saveFile (data, filename) {
      let save_link = document.createElementNS(
        "http://www.w3.org/1999/xhtml",
        "a"
      );
      save_link.href = data;
      save_link.download = filename;

      let event = document.createEvent("MouseEvents");
      event.initMouseEvent(
        "click",
        true,
        false,
        window,
        0,
        0,
        0,
        0,
        0,
        false,
        false,
        false,
        false,
        0,
        null
      );
      save_link.dispatchEvent(event);
    },

  },
  mounted () {
    // 显示地图  
    this.mapShow()
    this.getClientInfo()
    this.getAllCarList()
    
    // this.getClcList()
    // this.getPlacePointZZZApi()
    // this.getPlacePointCLCApi()
    // this.getPlacePointNCDApi()
    // this.getPlacePointCYApi()
    // this.getPlacePointXQCYApi()
    // 画线
    // setTimeout(() => {
    //   this.addLine()
    // }, 2000)
  }
}
</script>

<style scoped lang="less">
/deep/.BMap_cpyCtrl {
  display: none !important;
}
/deep/.anchorBL {
  display: none !important;
}
.buttonI {
  border: 1px solid #fff;
  padding: 0px 8px;
  border-radius: 6px;
}
.track_the_playback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  .around {
    padding: 10px;
    background-color: #007acc;
    height: 100%;
    border-radius: 5px;
    &:first-child {
      padding-left: 10px;
      height: auto;
      i {
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        //width: 30px;
        height: 30px;
        line-height: 28px;
        text-align: center;
        vertical-align: middle;
        cursor: pointer;
        margin-right: 15px;
      }
      // .el-icon-s-operation {
      //   font-size: 22px;
      // }
    }
  }
  .arounds {
    padding: 10px;
    background-color: #007acc;
    height: 35px;
    border-radius: 5px;
    // &:first-child {
    //   padding-left: 10px;
    //   height: auto;
    //   i {
    //     color: #fff;
    //     font-size: 18px;
    //     font-weight: bold;
    //     //width: 30px;
    //     height: 30px;
    //     line-height: 28px;
    //     text-align: center;
    //     vertical-align: middle;
    //     cursor: pointer;
    //     margin-right: 15px;
    //   }
    //   // .el-icon-s-operation {
    //   //   font-size: 22px;
    //   // }
    // }
  }
  .container {
    flex: 1;
    #mapPlayback {
      height: 100%;
    }
  }
}
h2 {
  font-size: 16px;
  height: 30px;
  line-height: 30px;
  padding-left: 15px;
  border-bottom: 2px solid #ccc;
  background-color: #f1f1f1;
  i {
    float: right;
    margin-right: 10px;
  }
}
.settingWindow {
  height: calc(~'100% - 32px');
}
.data_list {
  height: 485px;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  box-shadow: 0 0 5px 3px #ccc;
  border-radius: 8px;
  overflow: hidden;
}
.set_time_box {
  width: 340px;
  height: 160px;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 4px;
  box-shadow: 0 0 5px 3px #ccc;
  background-color: #fff;
  h2 {
    border-bottom: 1px solid #ccc;
  }
  .settingWindow {
    padding-top: 10px;
    & > div {
      height: 26px;
      line-height: 26px;
      margin-bottom: 5px;
      padding-left: 20px;
      & > span {
        padding-right: 15px;
      }
      & > .el-button {
        float: right;
        padding: 0 5px;
        margin-right: 10px;
        height: 26px;
        bottom: 20px;
        right: 20px;
        position: absolute;
      }
    }
    /deep/.el-date-editor.el-input {
      width: 190px;
    }
    /deep/.el-input--prefix .el-input__inner {
      height: 26px;
      border-radius: 2px;
      padding: 0;
      padding-left: 5px;
      overflow: hidden;
      border-color: #007acc;
      padding: 0;
      padding-left: 20px;
    }
    /deep/.el-input__icon {
      line-height: 26px;
    }
    /deep/.el-input__prefix {
      left: -1px;
    }
  }
}
.person_top {
  width: 150px;
  height: 130px;
  position: absolute;
  left: 20px;
  top: 100px;
  background-color: #b2dfee;
  border: 1px solid #ccc;
  p {
    height: 30px;
    // text-align: center;
    padding-left: 5px;
    padding-left: 10px;
    color: #333;
    span:first-child {
      text-align: center;
      padding-top: 14px;
      display: inline-block;
      width: 30px;
      height: 30px;
      margin-right: 5px;
      vertical-align: middle;
      img {
        background-size: 30px 30px;
      }
    }
  }
}
.speed {
  width: 300px;
  height: 120px;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 5px 3px #ccc;
  background-color: #fff;
  .el-slider {
    margin: 10px 15px 0px;
    padding: 0 10px;
  }
  .el-button {
    float: right;
    margin-right: 15px;
    padding: 0 5px;
    height: 26px;
  }
  .el-switch {
    border: 2px solid #fff;
  }
}
.map-operation {
  position: absolute;
  right: 35%;
  top: 110px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dcdfe6;
  border-radius: 5px;
  ul {
    li {
      list-style: none;
      float: left;
      color: #666;
      font-size: 14px;
      padding: 5px 12px;
      position: relative;
      cursor: pointer;
      i {
        margin-right: 3px;
        font-size: 14px;
        &:before {
          font-size: inherit;
          color: inherit;
        }
      }
      &::before {
        display: block;
        content: '';
        width: 1px;
        height: 13px;
        background: #dcdfe6;
        position: absolute;
        right: 0;
        top: 8px;
      }
      &:last-child {
        &::before {
          display: none;
        }
      }
      &.active {
        color: #007acc;
      }
    }
  }
}

.el-icon-speed {
  margin-left: 5px;
}
.buttonI {
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  height: 30px;
  line-height: 28px;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  padding: 5px 10px 5px 10px;
  margin: 5px;
}
.legend {
  width: 550px;
  position: absolute;
  right: 10px;
  bottom: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 5px 10px 0 10px;
  border-radius: 5px;
  h3 {
    height: 30px;
    text-align: center;
    line-height: 30px;
    color: #333;
    margin-bottom: 5px;
    i {
      float: right;
      cursor: pointer;
      &:before {
        color: #666;
      }
    }
  }
  p {
    // text-align: center;
    color: #333;
    float: left;
    width: 14%;
    margin-bottom: 20px;
    span {
      display: block;
      text-align: center;
      &:first-child {
        img {
          // background-size: 30px 30px;
          height: 40px;
        }
      }
    }
  }
}
.mini_legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background-color: #007acc;
  border: 1px solid #dcdfe6;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  &.right {
    right: 10px;
    left: auto;
  }
}
.road1 {
  margin: 15px;
  width: 45px;
  height: 15px;
  background-color: #f8df72;
}
.road2 {
  margin: 17px;
  width: 45px;
  height: 10px;
  background-color: #f8df72;
}
.road3 {
  margin: 19px;
  width: 45px;
  height: 5px;
  background-color: #f8df72;
}
</style>
